#ifndef EVALUATION_H
#define EVALUATION_H

#include <QMap>
#include "mission.h"

namespace IAlib
{

class IA_LIBSHARED_EXPORT Evaluation
{
public:
    Evaluation();

    static QList<ItsAction*> proceduresToItsActions(const QList<Procedure*> list);

    void setId(const QString& id) { m_id = id; }
    QString getId() const { return m_id; }

    void setSortedMissions(const QList<Mission*> missions) { m_sorted_missions = missions; }
    QList<Mission*> getSortedMission() const { return m_sorted_missions; }

    QList<Procedure*> getOptimalSequence() const { return m_optimal_sequence; }

    QMap<int, int> getSequenceEfficiencies() { return m_sequence_efficiency; }

    int getSequenceEfficiency(const int index) const;

    QList<int> getMostSimilarSequence() const { return m_most_similar_sequence; }

    QList<QList<Procedure*> > getAllPossibleSequence() const { return m_all_possible_sequences; }

    QList<bool**> getSimilarityMatrix() const { return m_similarity_matrix; }

    void exeEvaluation(const QList<ItsAction*> learner_actions);

    bool isOrdered() const { return m_order; }

    static bool orderObserved(const QList<ItsAction*>& referece, const QList<ItsAction*>& sample);
	static int getBestProcedure(const Mission& mission);

    int intersection_number(const int index) const;


private:

    QString m_id;
    bool    m_order;

    QList<ItsAction*>         m_learner_actions;
    QList<Mission*>           m_sorted_missions;
    QList<Procedure*>         m_optimal_sequence;
    QList<QList<Procedure*> > m_all_possible_sequences;
    QList<bool**>             m_similarity_matrix;
    QMap<int, int>            m_sequence_efficiency;
    QList<int>                m_most_similar_sequence;

};

}

#endif // EVALUATION_H
